package com.knowledge.data.entity;

import com.knowledge.data.constants.RespCodeEnum;

public class RespEntity<T> {

    /**
     * 响应前端结果码
     */
    private int respCode;

    /**
     * 响应前端结果描述
     */
    private String respMsg;

    /**
     * 响应前端业务参数
     */
    private T respData;

    public RespEntity() {
        this.respCode = RespCodeEnum.SUCCESS.getCode();
        this.respMsg = RespCodeEnum.SUCCESS.getMsg();
    }

    public RespEntity(int respCode, String respMsg) {
        this.respCode = respCode;
        this.respMsg = respMsg;
    }

    public int getRespCode() {
        return respCode;
    }

    public void setRespCode(int respCode) {
        this.respCode = respCode;
    }

    public String getRespMsg() {
        return respMsg;
    }

    public void setRespMsg(String respMsg) {
        this.respMsg = respMsg;
    }

    public T getRespData() {
        return respData;
    }

    public void setRespData(T respData) {
        this.respData = respData;
    }

    @Override
    public String toString() {
        return "RespEntity{" +
            "respData=" + respData +
            '}';
    }
}
